package com.ternnetwork.oa.controller.dashboard;

import com.ternnetwork.commons.model.http.BaseResponse;
import com.ternnetwork.commons.utils.JsonUtils;
import com.ternnetwork.oa.dto.note.NoteDto;
import com.ternnetwork.oa.dto.note.NoteQueryDto;
import com.ternnetwork.oa.dto.work.EventDto;
import com.ternnetwork.oa.service.dashboard.DashboardService;
import com.ternnetwork.oa.service.note.NoteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.data.web.PageableDefault;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.security.Principal;


@Controller
@RequestMapping("/dashboard/*")
public class DashboardController {


    @Autowired
    private DashboardService dashboardService;


    @RequestMapping("/getData")
    public @ResponseBody BaseResponse getData( Principal user) throws Exception {
        return dashboardService.getData(user.getName());
    }
}
